package com.wf.LeetCode;

import java.util.Arrays;
import java.util.Random;

/**
 * @author mpk
 * @since 2024/6/7 08:54:08
 */
public class MumTest {
    public static void main(String[] args) {

        int [] num={1,1,1,1,1,1,2,1,1,2};
        System.err.println(Arrays.toString(num));
        maxOperations(num);
        System.out.println(maxOperations(num));

        Random random = new Random();

        System.out.println(Math.random() );
        System.out.println(Math.random() );
        System.out.println(Math.random() );
        System.out.println(Math.random() );
        System.out.println(Math.random() );
        System.out.println(random.nextDouble());
        System.out.println(random.nextDouble());
        System.out.println(random.nextDouble());
        System.out.println(random.nextDouble());
        System.out.println(random.nextDouble());
    }

        public static int maxOperations(int[] nums) {
            if(nums.length<2)
            {
                return 0;
            }

            int sum=0;
            int first =nums[0]+nums[1];

            for (int i = 0; i < nums.length;i=i+2) {


                if(i>=nums.length||i+1 >= nums.length)
                {
                    break;
                }
                int j = nums[i] + nums[i + 1];

                sum=sum+j;
                if(first!=j)
                {
                    return (sum-j)/first;
                }

            }


            return sum/first;

        }

}



